﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MobileSales.Common.Logger;
using System.Runtime.Serialization;
using System.ComponentModel.DataAnnotations;
using MobileSales.Model.Localization;

namespace MobileSales.Model.Products
{
    [DataContract]
    public class Category
    {
        #region Public members
        [DataMember]
        public int Id { get; set; }
        [DataMember]
        [Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ValidationStrings))]
        [Display(Name = "Name", ResourceType = typeof(ModelStrings))]
        public string Name { get; set; }
        [DataMember]
        [Display(Name = "Description", ResourceType = typeof(ModelStrings))]
        public string Description { get; set; }
        [DataMember]
        [Display(Name = "ParentCategory", ResourceType = typeof(ModelStrings))]
        public int? ParentId { get; set; }
        [DataMember]
        public Category Parent { get; set; }
        [DataMember]
        public IList<Category> Children { get; set; }
        #endregion
    }
}
